home *** CD-ROM | disk | FTP | other *** search
- /* $VER: Dashboard 1.5 (01.09.96) (c) Neil Bothwick */
- /* */
- /* Central interface for Wirenet Internet operation */
-
- options results
-
- GuiFile = 'AmiTCP:dashboard.gui'
- cr = '0a'x
- pragma('Directory','AmiTCP:bin')
-
- if ~show('L','rexxsupport.library') then
- if ~addlib('rexxsupport.library',0,-30) then exit
-
- if ~show('L','rexxdossupport.library') then
- if ~addlib('rexxdossupport.library',0,-30) then exit
-
- if ~show('L','rexxreqtools.library') then
- if ~addlib('rexxreqtools.library',0,-30) then exit
-
- /* Load Varexx if necessary */
-
- if ~show('P','VAREXX') then do
- VarexxStarted = 'Yes'
- address command 'Varexx'
- address command 'WaitForPort VAREXX'
- end
-
- address VAREXX
-
- call openport('DashPort')
-
- 'load' GuiFile 'DashPort'
- host = result
- address value host
-
- /* Set up user-defined buttons */
- if exists('AmiTCP:db/User-Button.A') & exists('AmiTCP:db/User-Function.A') then do
- if open(name,'AmiTCP:db/User-Button.A','R') then do
- ButName = readln(name)
- setlabel 'USERA' '"'ButName'"'
- ButtonA = 1
- close(name)
- end
- end
- if exists('AmiTCP:db/User-Button.B') & exists('AmiTCP:db/User-Function.B') then do
- if open(name,'AmiTCP:db/User-Button.B','R') then do
- ButName = readln(name)
- setlabel 'USERB' '"'ButName'"'
- ButtonB = 1
- close(name)
- end
- end
-
- show 'Dashboard'
- call EnableAll(1)
-
-
- Busy SET
- address command 'StartNet'
- Busy
-
- do forever
- call waitpkt('DashPort')
- packet = getpkt('DashPort')
- Action = getarg(packet)
-
- select
- when Action = 'CONNECT' then call Connect
- when Action = 'DISCONNECT' then call Disconnect
- when Action = 'GET' then call Get
- when Action = 'BROWSE' then call Browse
- when Action = 'FTP' then call FTP
- when Action = 'WWW' then call WWW
- when Action = 'READ' then call Read
- when Action = 'USERA' then call UserA
- when Action = 'USERB' then call Userb
- when Action = 'EXIT' then call Exit(0)
- when Action = 'QUIT' then call Exit(1)
- when Action = 'CLOSEWINDOW' then call Exit(0)
- when Action = 'TITLE' then call About
- otherwise nop
- end
- end
-
- exit
-
-
- EnableAll:
- arg flag
- GadList = 'TITLE CONNECT CONNECTTYPE DISCONNECT DISCONNECTTYPE GET GETTYPE WWW FTP BROWSE READ USERA USERB EXIT QUIT'
- if flag = 1 then do
- do i = 1 to words(GadList)
- set word(GadList,i) enable
- end
- if ButtonA ~= 1 then set 'USERA' disable
- if ButtonB ~= 1 then set 'USERB' disable
- end
-
- else
- do i = 1 to words(GadList)
- set word(GadList,i) disable
- end
- return
-
- Connect:
- Busy SET
- read CONNECTTYPE
- ConType = result
- address command
- select
- when upper(GetVar(NetState)) = 'ONLINE' then call Request('You are already connected')
- when ConType = 0 then 'Connect'
- when ConType = 1 then 'Connect Mail'
- when ConType = 2 then 'Connect News'
- when ConType = 3 then 'Connect AutoMail'
- when ConType = 4 then 'Connect AutoNews'
- otherwise nop
- end
- address
- Busy
- return
-
- Disconnect:
- Busy SET
- read DISCONNECTTYPE
- DisconType = result
- address command
- if DisconType = 0 then 'Connect Off'
- else 'Connect AutoOff'
- address
- Busy
- return
-
- FTP:
- Busy SET
- address command 'Run >NIL: AmiTCP:AmiFTP'
- Busy
- return
-
- WWW:
- Busy SET
- address command 'Run >NIL: AmiTCP:AWeb/AWeb'
- Busy
- return
-
- Get:
- Busy SET
- if exists('ENV:FetchState') then do
- call Request('You are already downloading' GetVar('FetchState')||cr||'Please wait until this has finished before trying again')
- end
- else do
- read GETTYPE
- FetchType = result
- address command
- select
- when FetchType = 0 then 'run >NIL: Fetch Mail'
- when FetchType = 1 then 'run >NIL: Fetch News'
- when FetchType = 2 then 'run >NIL: Fetch All'
- otherwise nop
- end
- address
- end
- Busy
- return
-
- Read:
- Busy SET
- address command 'run >NIL: run >nil: `GetEnv THOR/THORPath`Thor System=Wirenet FF'
- Busy
- return
-
- Browse:
- if upper(GetVar(NetState)) ~= 'ONLINE' then do
- call Request('You need to be connected'||cr||' to use this function')
- return
- end
- Busy SET
- address command 'run >NIL: run >nil: `GetEnv THOR/THORPath`ConnectThor'
- Busy
- return
-
- UserA:
- Busy SET
- if exists('AmiTCP:db/User-Function.A') then address command 'AmiTCP:db/User-Function.A'
- Busy
- return
-
- UserB:
- Busy SET
- if exists('AmiTCP:db/User-Function.B') then address command 'AmiTCP:db/User-Function.B'
- Busy
- return
-
- Exit:
- parse arg Quit
- Busy SET
- if Quit = 1 & upper(GetVar(NetState)) = 'ONLINE' then do
- if rtezrequest('This will disconnect you!'||cr||'Are you sure?',' _Yes |_No',,'rtez_defaultresponse=0') = 1 then call Disconnect
- else do
- Busy
- return
- end
- end
- 'hide UNLOAD'
- call closeport('DashPort')
- if VarexxStarted = 'Yes' then address command 'SYS:Rexxc/VXC'
- if Quit = 1 then address Command 'StopNet'
- exit
- return
-
- About:
- Busy SET
- AboutMsg = 'Wirenet Dashboard (c) Neil Bothwick, 1996'cr|| cr'Created using Varexx by Andy Cook'cr'GadToolsBox by Jan van den Baard'
- if rtezrequest(AboutMsg,' _OK |_Help',,'rt_reqpos=reqpos_centerwin') = 0 then
- address command 'Multiview AmiTCP:doc/Dashboard.guide'
- Busy
- return
-
- Request:
- parse arg Message
- call rtezrequest(Message,' _OK ')
- return
-
-